<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\UserTeam
 *
 * @property int $id
 * @property string|null $name 等级名称
 * @property int|null $user_num 直推会员数量
 * @property int|null $user_money 用户金额 单位为分 防止浮点数错误
 * @property float|null $reward 设置团队分成比例
 * @property int|null $level 会员等级 标记级别高低
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereReward($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereUserMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\UserTeam whereUserNum($value)
 * @mixin \Eloquent
 */
class UserTeam extends Model
{
    protected $table='user_teams';
    public static function getSelectOptions()
    {
        $options = \DB::table('user_teams')->select('level','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->level] = $option->text;
        }
        return $selectOption;
    }
}
